# -*- coding: utf-8 -*-
import os

SECRET_KET = os.urandom(24)
SQLALCHEMY_TRACK_MODIFICATIONS = False

MAX_CONTENT_LENGTH = 16 * 1024 * 1024
if os.environ.get('MIGONG') == 'PRODUCTION':
    UPLOAD_DIR = "/static"
else:
    UPLOAD_DIR = os.path.join(os.path.dirname(__file__), "static/tmp")
if os.path.exists(UPLOAD_DIR) is False:
    os.makedirs(UPLOAD_DIR)
head_dir = os.path.join(UPLOAD_DIR, 'head')
if os.path.exists(head_dir) is False:
    os.makedirs(head_dir)

wx_session_url = "https://api.weixin.qq.com/sns/jscode2session"
wx_access_token_url = "https://api.weixin.qq.com/cgi-bin/token"

# 个人端
WX_CONFIG = {
    "appid": "wxd1e4674a3be57419",
    "secret": "8e5d7414df6a2eb118b25f075282cb74",
    "grant_type": "authorization_code"
}

# 企业端
WX_COMPANY_CONFIG = {
    "appid": "wxba3e3a0565df6573",
    "secret": "8e7bfadc75d00efa4cf2732ab476a165",
    "grant_type": "authorization_code"
}

# 蜜工服务号
WX_SERVICE_CONFIG = {
    'token': 'zsEbzoNzRai8QvpU1',
    'key': 'X4qnFLOzajwVucMycLmLPzL6aqmRM3iIAgwWqtRqJcy',
    'appid': 'wx1344cc10a22620f9',
    'secret': '623e7b667ea709ed37c6b866c5f29cd4'
}
